%
% A quick plotting function for a vector of interval-represented normal fuzzy numbers.
% Alpha values are assumed to be uniformly distributed between [0,1].
% A new figure is generated each time this is called, and the colors of the represented sets
% cycle through 1-6.  So technically you can plot as many as you want, but its usefulness 
% diminishes rapidly as the number of sets increases beyond six unless identification of the
% individual components of the vectors are easy.
% The value z should be a matrix of size [N,2*m] for a m-dimension fuzzy vector and the format
% is assumed to be [[l1,h1],[l2,h2],...,[lm,hm]]
%
function fuzzy_plot(z)

colors = [1:6];

sz = size(z);

count = sz(2) / 2;

if(round(count) ~= count)
	error('Malformed data');
end

a = alphas(size(z)(1));

a = [a; a(end:-1:1)];

figure;
hold on;
for ii = 1:count
	plot([z(:,ii .* 2 -1); z(end:-1:1,ii .* 2)], a, sprintf('%d',colors(ii)));
end
hold off;
